const { Comment } = require('../../model/comment');
module.exports = async (req,res)=>{
  const { content, uid , aid } = req.body;
  //将评论信息存储到评论集合中
  await Comment.create({
    content: content,
    uid: uid,
    aid: aid,
    time: new Date(),
    state: 1
  });
  //将页面重定向到文章详情页
  res.redirect('/home/article_details?id='+aid);
}